import java.util.Arrays;

public class Solution1093 {
    public double[] sampleStats(int[] count) {
        int min=-1;
        for (int i=0;i<count.length;i++){
            if (count[i]>0){
                min=i;
                break;
            }
        }
        int max=-1;
        for (int i=count.length-1;i>=0;i--){
            if (count[i]>0){
                max=i;
                break;
            }
        }
        int total=0;
        double sum=0;
        for (int i=0;i<count.length;i++){
            total+=count[i];
            sum+=(double)i*count[i];
        }
        int most=-1,maxNum=0;
        for (int i=0;i<count.length;i++){
            if (count[i]>maxNum){
                maxNum=count[i];
                most=i;
            }
        }
        double target;
        if (total%2==0){
            target= (get(count,total/2)+get(count,total/2+1)) /2;
        }else{
            target=get(count,total/2+1);
        }
        return new double[]{min,max, sum /total,target,most};
    }

    private double get(int[] count, int t) {
        for (int i=0;i<count.length;i++){
            if (count[i]>0){
                if (t-count[i]>0){
                    t-=count[i];
                }else {
                    return i;
                }
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new Solution1093().sampleStats(new int[]{0, 1, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})));
    }
}
